home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / howtos1r / frmview.frm < prev    next >
Text File  |  1999-08-11  |  4KB  |  128 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmView 
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "View Current Graph"
  7.    ClientHeight    =   2550
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   6060
  11.    Icon            =   "frmView.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   170
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   404
  18.    StartUpPosition =   1  'CenterOwner
  19.    Begin VB.CommandButton cmdExport 
  20.       Caption         =   "Export To a Bitmap"
  21.       Height          =   375
  22.       Left            =   0
  23.       TabIndex        =   4
  24.       Top             =   2175
  25.       Width           =   6060
  26.    End
  27.    Begin VB.CommandButton cmdClose 
  28.       Cancel          =   -1  'True
  29.       Caption         =   "Close"
  30.       Height          =   375
  31.       Left            =   0
  32.       TabIndex        =   2
  33.       Top             =   1800
  34.       Width           =   6060
  35.    End
  36.    Begin VB.HScrollBar Scroll 
  37.       Height          =   240
  38.       LargeChange     =   100
  39.       Left            =   0
  40.       SmallChange     =   10
  41.       TabIndex        =   1
  42.       Top             =   1560
  43.       Width           =   6060
  44.    End
  45.    Begin VB.PictureBox Picture1 
  46.       BackColor       =   &H00000000&
  47.       Height          =   1620
  48.       Left            =   0
  49.       ScaleHeight     =   104
  50.       ScaleMode       =   3  'Pixel
  51.       ScaleWidth      =   400
  52.       TabIndex        =   0
  53.       Top             =   0
  54.       Width           =   6060
  55.       Begin MSComDlg.CommonDialog Dialog 
  56.          Left            =   1920
  57.          Top             =   840
  58.          _ExtentX        =   847
  59.          _ExtentY        =   847
  60.          _Version        =   327681
  61.          DefaultExt      =   "*.bmp"
  62.          DialogTitle     =   "Save"
  63.          Filter          =   "Bitmaps|*.bmp"
  64.          MaxFileSize     =   10000
  65.       End
  66.       Begin VB.PictureBox picView 
  67.          AutoRedraw      =   -1  'True
  68.          BackColor       =   &H00000000&
  69.          BorderStyle     =   0  'None
  70.          Height          =   1500
  71.          Left            =   5040
  72.          ScaleHeight     =   100
  73.          ScaleMode       =   3  'Pixel
  74.          ScaleWidth      =   10
  75.          TabIndex        =   3
  76.          Top             =   30
  77.          Width           =   150
  78.       End
  79.    End
  80. End
  81. Attribute VB_Name = "frmView"
  82. Attribute VB_GlobalNameSpace = False
  83. Attribute VB_Creatable = False
  84. Attribute VB_PredeclaredId = True
  85. Attribute VB_Exposed = False
  86. Private Sub cmdClose_Click()
  87. frmGraph.lblopt(0).ForeColor = RGB(0, 255, 0)
  88. Unload Me
  89. End Sub
  90.  
  91.  
  92. Private Sub cmdExport_Click()
  93. On Error GoTo Twat:
  94. Dialog.InitDir = App.Path
  95. Dialog.ShowOpen
  96. If Dialog.Filename <> "" Then
  97.     SavePicture picView.Image, Dialog.Filename
  98.     MsgBox "Saved to '" & Dialog.Filename & "'", vbInformation, "Success"
  99. End If
  100. Exit Sub
  101. Twat:
  102. MsgBox "Could Not Save to '" & Dialog.Filename & "'", vbInformation, "No Success"
  103. End Sub
  104.  
  105.  
  106. Private Sub Form_Load()
  107. picView.Width = frmGraph.picGraph.Width
  108. picView.Left = Picture1.ScaleWidth - picView.Width
  109. Scroll.Max = picView.Width
  110. Scroll.Value = Scroll.Max
  111. 'NOTE: 1 less than a quater to allow for there being a row valued '0' on the X axis
  112. picView.Line (0, 24)-(picView.ScaleWidth, 24), RGB(128, 128, 128)
  113. picView.Line (0, 49)-(picView.ScaleWidth, 49), RGB(128, 128, 128)
  114. picView.Line (0, 74)-(picView.ScaleWidth, 74), RGB(128, 128, 128)
  115. End Sub
  116.  
  117. Private Sub Picture1_Click()
  118. frmView.picView.Line (0, 24)-(picView.Width, 24), RGB(255, 255, 255)
  119. frmView.picView.Line (0, 49)-(picView.Width, 49), RGB(255, 255, 255)
  120. frmView.picView.Line (0, 74)-(picView.Width, 74), RGB(255, 255, 255)
  121. End Sub
  122.  
  123. Private Sub Scroll_Change()
  124. picView.Left = Picture1.ScaleWidth - Scroll.Value
  125. End Sub
  126.  
  127.  
  128.